<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="Apache Forrest" name="Generator">
<meta name="Forrest-version" content="0.8-dev">
<meta name="Forrest-skin-name" content="pelt">
<title>Frequently Asked Questions</title>
<link type="text/css" href="../skin/basic.css" rel="stylesheet">
<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
<link type="text/css" href="../skin/profile.css" rel="stylesheet">
<script src="../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../skin/fontsize.js" language="javascript" type="text/javascript"></script>
<link rel="shortcut icon" href="../">
</head>
<body onload="init()">
<script type="text/javascript">ndeSetTextSize();</script>
<div id="top">
<!--+
    |header
    +-->
<div class="header">
<!--+
    |start group logo
    +-->
<div class="grouplogo">
<a href="http://www.pdfbox.org"><img class="logoImage" alt="" src="../images/Logo.gif" title="PDFBox: Java PDF Library"></a>
</div>
<!--+
    |end group logo
    +-->
<!--+
    |start Project Logo
    +-->
<div class="projectlogoA1">
<a href=""></a>
</div>
<!--+
    |end Project Logo
    +-->
<!--+
    |start Tabs
    +-->
<ul id="tabs">
<li class="current">
<a class="base-selected" href=".././index.html">Home</a>
</li>
</ul>
<!--+
    |end Tabs
    +-->
</div>
</div>
<div id="main">
<div id="publishedStrip">
<!--+
    |start Subtabs
    +-->
<div id="level2tabs"></div>
<!--+
    |end Endtabs
    +-->
<script type="text/javascript"><!--
document.write("Last Published: " + document.lastModified);
//  --></script>
</div>
<!--+
    |breadtrail
    +-->
<div class="breadtrail">
             
             &nbsp;
           </div>
<!--+
    |start Menu, mainarea
    +-->
<!--+
    |start Menu
    +-->
<div id="menu">
<div onclick="SwitchMenu('menu_1.1', '../skin/')" id="menu_1.1Title" class="menutitle">About</div>
<div id="menu_1.1" class="menuitemgroup">
<div class="menuitem">
<a href="../index.html" title="Welcome to PDFBox">Index</a>
</div>
<div class="menuitem">
<a href="http://sourceforge.net/project/showfiles.php?group_id=78314" title="Download PDFBox">Download</a>
</div>
<div class="menuitem">
<a href="http://www.pdfbox.org/dist/" title="Download a nightly release of PDFBox">Nightly Build</a>
</div>
<div class="menuitem">
<a href="http://sourceforge.net/forum/?group_id=78314" title="Discuss PDFBox">Forums</a>
</div>
<div class="menuitem">
<a href="http://sourceforge.net/tracker/?group_id=78314&atid=552832" title="Submit an issue">Issues</a>
</div>
<div class="menuitem">
<a href="http://www.sf.net/projects/pdfbox" title="SourceForge Site">SourceForge</a>
</div>
<div class="menuitem">
<a href="../references.html" title="References">References</a>
</div>
<div class="menuitem">
<a href="../donations.html" title="Donations">Donations</a>
</div>
<div class="menuitem">
<a href="../changes.html" title="Release Notes">Release Notes</a>
</div>
</div>
<div onclick="SwitchMenu('menu_1.2', '../skin/')" id="menu_1.2Title" class="menutitle">Command Line Utilities</div>
<div id="menu_1.2" class="menuitemgroup">
<div class="menuitem">
<a href="../commandlineutilities/index.html" title="Index">Index</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/Decrypt.html" title="Decrypt">Decrypt</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/Encrypt.html" title="Encrypt">Encrypt</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/ExtractText.html" title="ExtractText">ExtractText</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/PDFToImage.html" title="PDFToImage">PDFToImage</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/PrintPDF.html" title="PrintPDF">PrintPDF</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/ConvertColorspace.html" title="Convert PDF colorspace, ie RGB to CMYK">ConvertColorspace</a>
</div>
<div class="menuitem">
<a href="../commandlineutilities/TextToPDF.html" title="TextToPDF">TextToPDF</a>
</div>
</div>
<div onclick="SwitchMenu('menu_selected_1.3', '../skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Developers Guide</div>
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
<div class="menuitem">
<a href="../userguide/index.html" title="A note on the docs">Index</a>
</div>
<div class="menuitem">
<a href="../userguide/bookmarks.html" title="PDF Bookmarks">Bookmarks</a>
</div>
<div class="menuitem">
<a href="../userguide/building_pdfbox.html" title="Building PDFBox">Building PDFBox</a>
</div>
<div class="menupage">
<div class="menupagetitle">FAQ</div>
</div>
<div class="menuitem">
<a href="../userguide/file_references.html" title="Documentation on embedded and externally referenced files">File References</a>
</div>
<div class="menuitem">
<a href="../userguide/fonts.html" title="Fonts in PDFBox">Fonts</a>
</div>
<div class="menuitem">
<a href="../userguide/highlighting.html" title="Highlighting text in a PDF">Highlighting</a>
</div>
<div class="menuitem">
<a href=".././javadoc/index.html" title="Javadoc API">Javadoc</a>
</div>
<div class="menuitem">
<a href="../userguide/metadata.html" title="XMP Metadata">Metadata</a>
</div>
<div class="menuitem">
<a href="../userguide/dot_net.html" title=".NET Version">.NET Version</a>
</div>
<div class="menuitem">
<a href="../userguide/text_extraction.html" title="PDF Text Extraction">Text Extraction</a>
</div>
</div>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
<!--+
  |alternative credits
  +-->
<div id="credit2"></div>
</div>
<!--+
    |end Menu
    +-->
<!--+
    |start content
    +-->
<div id="content">
<div title="Portable Document Format" class="pdflink">
<a class="dida" href="faq.pdf"><img alt="PDF -icon" src="../skin/images/pdfdoc.gif" class="skin"><br>
        PDF</a>
</div>
<h1>Frequently Asked Questions</h1>
<div id="minitoc-area">
<ul class="minitoc">
<li>
<a href="#Questions">Questions</a>
<ul class="minitoc">
<li>
<a href="#general_questions">1. General Questions</a>
<ul class="minitoc">
<li>
<a href="#next_version">1.1. 
        When will the next version of PDFBox be released?
      </a>
</li>
<li>
<a href="#log4j_config">1.2. 
          I am getting the below Log4J warning message, how do I remove it?

      </a>
</li>
<li>
<a href="#pdfbox_threadsafe">1.3. 
      Is PDFBox thread safe?
      </a>
</li>
<li>
<a href="#pdfbox_close_warning">1.4. 
      Why do I get a "Warning: You did not close the PDF Document"?
      </a>
</li>
</ul>
</li>
<li>
<a href="#text_extraction">2. Text Extraction</a>
<ul class="minitoc">
<li>
<a href="#no_text_extraction">2.1. 
        How come I am not getting any text from the PDF document?
      </a>
</li>
<li>
<a href="#gibberish_text">2.2. 
        How come I am getting gibberish(G38G43G36G51G5) when extracting text?
      </a>
</li>
<li>
<a href="#cant_handle_font_width">2.3. 
        What does "java.io.IOException: Can't handle font width" mean?
      </a>
</li>
<li>
<a href="#no_permission">2.4. 
        Why do I get "You do not have permission to extract text" on some documents?
      </a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<a name="N10007"></a><a name="Questions"></a>
<h2 class="boxed">Questions</h2>
<div class="section">
<a name="N1000B"></a><a name="general_questions"></a>
<h3 class="boxed">1. General Questions</h3>
<a name="N1000F"></a><a name="next_version"></a>
<h4 class="faq">1.1. 
        When will the next version of PDFBox be released?
      </h4>
<div align="right">
<a href="#next_version-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
          As fixes are made and integrated into CVS these changes are documented in the
          <a href="../changes.html">release notes</a>.  I will give an estimate of when
          the next version will be released. <br>
<br>
          Of course, this is only an estimate and could change.
        </p>
</div>
<a name="N1001E"></a><a name="log4j_config"></a>
<h4 class="faq">1.2. 
          I am getting the below Log4J warning message, how do I remove it?

      </h4>
<div align="right">
<a href="#log4j_config-menu">^</a>
</div>
<div style="margin-left: 15px">
<table class="ForrestTable" cellspacing="1" cellpadding="4">
  	
<tr>
<td colspan="1" rowspan="1">
  	log4j:WARN No appenders could be found for logger (org.pdfbox.util.ResourceLoader).<br>
	log4j:WARN Please initialize the log4j system properly.
	</td>
</tr>
  
</table>
<p>
        This message means that you need to configure the log4j logging system.  
        See the <a href="http://logging.apache.org/log4j/docs/documentation.html">log4j documentation</a> for more information.
        </p>
<p>
        PDFBox comes with a sample log4j configuration file.  To use it you set a 
		system property like this
		</p>
<p>

		java -Dlog4j.configuration=log4j.xml org.pdfbox.ExtractText &lt;PDF-file&gt; &lt;output-text-file&gt;
        </p>
<p>
        If this is not working for you then you may have to specify the log4j config file using a URL path, like this:<br>
        
<br>
        log4j.configuration=file:///&lt;path to config file&gt;<br>
        
<br>
        Please see <a href="https://sourceforge.net/forum/forum.php?thread_id=1254229&forum_id=267205">this</a> forum thread for more information.
        
        </p>
</div>
<a name="N1004A"></a><a name="pdfbox_threadsafe"></a>
<h4 class="faq">1.3. 
      Is PDFBox thread safe?
      </h4>
<div align="right">
<a href="#pdfbox_threadsafe-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
        No!  Only one thread may access a single document at a time.  
        You can have multiple threads each accessing there own PDDocument object.
        </p>
</div>
<a name="N10052"></a><a name="pdfbox_close_warning"></a>
<h4 class="faq">1.4. 
      Why do I get a "Warning: You did not close the PDF Document"?
      </h4>
<div align="right">
<a href="#pdfbox_close_warning-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
        You need to call close() on the PDDocument inside the finally block, if you
        don't then the document will not be closed properly.  Also, you must close all 
        PDDocument objects that get created.  The following code creates <b>two</b> 
        PDDocument objects; one from the "new PDDocument()" and the second by the load method.
        </p>
<pre>
    PDDocument doc = new PDDocument();
    try
    {
        doc = PDDocument.load( "my.pdf" );
    }
    finally
    {
        if( doc != null )
        {
            doc.close();
        }
    }
        </pre>
</div>
<a name="N10060"></a><a name="text_extraction"></a>
<h3 class="boxed">2. Text Extraction</h3>
<a name="N10064"></a><a name="no_text_extraction"></a>
<h4 class="faq">2.1. 
        How come I am not getting any text from the PDF document?
      </h4>
<div align="right">
<a href="#no_text_extraction-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
          Text extraction from a pdf document is a complicated task and there are many factors
          involved that effect the possibility and accuracy of text extraction.  It would be helpful
          to the PDFBox team if you could try a couple things.
        </p>
<ul>
          	
<li>Open the PDF in Acrobat and try to extract text from there.  If Acrobat can extract text
          	then PDFBox should be able to as well and it is a bug if it is not.  If Acrobat cannot extract text then
          	PDFBox 'probably' cannot either.</li>
          	
<li>It might really be an image instead of text.  Some PDF documents are just images that have
          	been scanned in.  You can tell by using the selection tool in Acrobat, if you can't select 
          	any text then it is probably an image.</li>
          
</ul>
</div>
<a name="N10075"></a><a name="gibberish_text"></a>
<h4 class="faq">2.2. 
        How come I am getting gibberish(G38G43G36G51G5) when extracting text?
      </h4>
<div align="right">
<a href="#gibberish_text-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
          This is because the characters in a PDF document can use a custom encoding 
          instead of unicode or ASCII.  When you see gibberish text then it
          probably means that a meaningless internal encoding is being used.  The
		   only way to access the text is to use OCR.  This may be a future
		   enhancement.
        </p>
</div>
<a name="N1007D"></a><a name="cant_handle_font_width"></a>
<h4 class="faq">2.3. 
        What does "java.io.IOException: Can't handle font width" mean?
      </h4>
<div align="right">
<a href="#cant_handle_font_width-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
          This probably means that the "Resources" directory is not in your classpath.  The 
          Resources directory is included in the PDFBox jar so this is only a problem if you 
          are building PDFBox yourself and not using the binary.
        </p>
</div>
<a name="N10085"></a><a name="no_permission"></a>
<h4 class="faq">2.4. 
        Why do I get "You do not have permission to extract text" on some documents?
      </h4>
<div align="right">
<a href="#no_permission-menu">^</a>
</div>
<div style="margin-left: 15px">
<p>
          PDF documents have certain security permissions that can 
          be applied to them and two passwords associated with them, a user password and a master password. 
          If the "cannot extract text" permission bit is set then you need 
          to decrypt the document with the master password in order to extract the text. 
        </p>
</div>
</div>
</div>
<!--+
    |end content
    +-->
<div class="clearboth">&nbsp;</div>
</div>
<div id="footer">
<!--+
    |start bottomstrip
    +-->
<div class="lastmodified">
<script type="text/javascript"><!--
document.write("Last Published: " + document.lastModified);
//  --></script>
</div>
<div class="copyright">
        Copyright &copy;
         2002-2006 PDFBox.org</div>
<div id="feedback">
    Send feedback about the website to:
  <a id="feedbackto" href="mailto:webmaster@pdfbox.org?subject=Feedback%C2%A0userguide/faq.html">webmaster@pdfbox.org</a>
</div>
<!--+
    |end bottomstrip
    +-->
</div>
</body>
</html>
